package com.example.android_learn;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;

public class MainActivity extends AppCompatActivity {
    String msg = "Android: ";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
//        getMenuInflater().inflate(R.menu.menu_main, menu);
        return super.onCreateOptionsMenu(menu);
    }

    public void startService(View view) {
        startService(new Intent(getBaseContext(), MyService.class));
    }

    public void stopService(View view) {
        stopService(new Intent(getBaseContext(), MyService.class));
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(msg, "onStart");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(msg, "onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d(msg, "onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d(msg, "onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d(msg, "onDestroy");
    }
}